package com.itheima.service.impl;

import com.itheima.config.SpringConfig;
import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.Date;
import java.util.List;

/**
 * @Name TripServiceImpl
 * @Author BaiXin
 * @Date 2022-10-16 18:23
 */
@Service
public class TripServiceImpl implements TripService {
    @Autowired
    private TripMapper tripMapper;

    @Override
    public List<Trip> findAll() {
        List<Trip> trips = tripMapper.findAll();
        return trips;
    }

    @Override
    public void add(Trip trip) {

        tripMapper.add(trip);
    }

    @Override
    public Trip findById(Integer id) {
        Trip trip = tripMapper.findById(id);
        return trip;
    }

    @Override
    public void updateById(Trip trip) {
        tripMapper.updateById(trip);
    }

    @Override
    public void deleteById(Integer id) {
        tripMapper.deleteById(id);
    }


}
